package com.example.splash;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity2 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
//输入框判断密码和用户名
        Button button2 = findViewById(R.id.button2);
        button2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                EditText EditText = findViewById(R.id.editTextText);
                String inputValue = EditText.getText().toString().trim();
                EditText editTextText2 = findViewById(R.id.editTextText2);
                String inputValue2 = editTextText2.getText().toString().trim();
                if ("1001".equals(inputValue)&&"18752359862".equals(inputValue2)){
                    Intent intent = new Intent(MainActivity2.this,MainActivity3.class);
                    startActivity(intent);
                }else {
                    Toast.makeText(MainActivity2.this, "用户名或密码错误", Toast.LENGTH_SHORT).show();
                }
            }
        });
    }
}